<!doctype html>
<html>
<head>
    <title>统计汇总页面</title>
    <?php $this->load->module('admin/index/page_header');?>
    <link href="<?php echo URLPRE;?>static/admin/css/font_icon.css" rel="stylesheet" />
    <script type="text/javascript" src="<?php echo URLPRE;?>static/public/Lib/Kalendajs/build/kalendae.standalone.js"></script>
    <link href="<?php echo URLPRE;?>static/public/Lib/Kalendajs/build/kalendae.css" rel="stylesheet" />
	<script type="text/javascript" src="<?php echo URLPRE;?>static/public/Lib/select2/select2.min.js"></script>
    <script type="text/javascript" src="<?php echo URLPRE;?>static/public/Lib/select2/select2_locale_zh-CN.js"></script>
    <link href="<?php echo URLPRE;?>static/public/Lib/select2/select2.css" rel="stylesheet" />
    <link href="<?php echo URLPRE;?>static/public/Lib/select2/select2-bootstrap.css" rel="stylesheet" />
</head>
<body>
<div class="wrap J_check_wrap">
    <form method="post" action="<?php echo $index_url?>">
        <div class="table_list" id="content">
            <div class="h_a">汇总业绩</div>
            <table width="100%">
                <tbody>
                <tr>
                    <td>
                        订单编号：<input type="text" value="<?php echo $condition['order_sn']?>" placeholder="订单编号" name="order_sn" class="input rounded" size="20" />&nbsp;&nbsp;
                       供应商：<select id="supplier" name="supplier_id" style=" width:300px">
                                 <option></option>
                                <?php echo $suppliers;?>
                            </select>               
                        分销商：<input type="text" name="admin_user_name" value="<?php echo $condition['admin_user_name']?>" placeholder="分销商" class="input rounded">
                        </td></tr><tr><td>
                          线路名称：<input type="text" value="<?php echo $condition['line']?>" placeholder="线路编号/名称" name="line" class="input rounded" size="20" />&nbsp;&nbsp;
                     <input type="hidden" name="cat_type" value="8">  <input type="hidden" name="line_sort" value="<?php echo $condition['line_sort']?>">
                        团期：<input type="text" value="<?php echo $condition['start_date']?>" placeholder="团期" class="input rounded" name="start_date" id="Kalendae" />~<input type="text" value="<?php echo $condition['end_date']?>" placeholder="团期" class="input rounded" name="end_date" id="Kalendae2" />
                        &nbsp;&nbsp;<input type="submit" class="btn" value="搜索">
                        <a class="btn" style="float:right;display:none" href="<?php echo $download_url?>">下载</a>
                    </td>
                </tr>
                </tbody>
            </table>
            <table cellpadding="1" cellspacing="0" border="1" width="1610">
                <tr>
                	<td align="center" colspan="6">基本信息</td>
                    <td align="center" colspan="3">应收团款</td>
                    <td align="center" colspan="1">成本</td>
                    <td align="center" colspan="1">利润</td>
                </tr>
                <tr>
                    <td width="30">序号</td>
                    <td width="70">发团日期</td>
                    <td width="130">订单编号</td>
                    <td width="60">线路名称</td>
                    <td width="30">发团人数</td>
                    <td width="30">分销商</td>
                    <td width="60">销售合计</td>
                    <td width="60">已收款</td>
                    <td width="60">余款</td>
                    <td width="60">成本总额</td>
                    <td width="60">利润</td>
                </tr>
                <?php if($list):?>
                    <tbody>
                    <?php foreach($list as $key=>$val):?>
                        <tr>
                            <td><?php echo $key+1;?></td>
                            <td><?php echo $val['go_date'];?></td>
                            <td><?php echo $val['order_sn'];?></td>
                            <td><a title="<?php echo $val['line_name']?>"><?php echo sub_str($val['line_name'],0,4)?></a></td>
                            <td class="total_num"><?php echo $val['total_num']?>
                            	<div class="jiage">
                                <?php foreach($val['price_cate'] as $p):?>
                                <?php if($p['num']){echo $p['price_name'].'&nbsp;&nbsp;'.$p['price'].'&nbsp;X&nbsp;'.$p['num'].'<br>';}?>
								<?php endforeach;?>
                                </div>
                            </td>
                            <td><?php echo $val['admin_user_name']?></td>
                            <td><?php echo intval($val['order_account']);?></td>
                            <td><?php echo intval($val['paid_account']);?></td>
                            <td><?php echo intval($val['order_account']-$val['paid_account']-$val['paid_supplier']);?></td>
                            <td><?php echo intval($val['cb_account']);?></td>
                            <td><?php echo $val['order_account']-$val['cb_account']?></td>
                        </tr>
                    <?php endforeach;?>
                    <tr style="color:#060; font-size:14px; font-weight:800;">
                        <td align="center" colspan="2"><font color="#FF0000">总计（当前页）</font></td>
                        <td colspan="4"></td>
                        <td><?php echo intval($page_total['order_account'])?></td>
                        <td><?php echo intval($page_total['paid_account'])?></td>
                        <td><?php echo intval($page_total['order_account']-$page_total['paid_account'])?></td>
                        <td><?php echo intval($page_total['cb_account'])?></td>
                        <td><?php echo intval($page_total['order_account']-$page_total['cb_account'])?></td>
                    </tr>
                    <?php if($all_total):?>
                    <tr style="color:#F00; font-size:14px; font-weight:800;">
                    	<td align="center" colspan="2"><font color="#FF0000">总计</font></td>
                        <td colspan="4"></td>
                        <td><?php echo intval($all_total['order_account_total'])?></td>
                        <td><?php echo intval($all_total['paid_account_total'])?></td>
                        <td><?php echo intval($all_total['order_account_total']-$all_total['paid_account_total'])?></td>
                        <td><?php echo intval($all_total['cb_account_total'])?></td>
                        <td><?php echo intval($all_total['order_account_total']-$all_total['cb_account_total'])?></td>
                    </tr>
                    <?php endif;?>
                    </tbody>
                <?php endif;?>
            </table>
        </div>
    </form>
    <div class="page_nav">
        <?php  echo $this->mypageclass->show(2); ?>
    </div>
</div>
<script type="text/javascript">
$(function(){
	$('#supplier').select2({placeholder: "请选择线路供应商",allowClear: true});
    var kal_dae = new Kalendae.Input('Kalendae', {
        months:1,
        mode:'single',
        format:'YYYY-MM-DD',
    });
	var kal_dae2 = new Kalendae.Input('Kalendae2', {
        months:1,
        mode:'single',
        format:'YYYY-MM-DD',
    });
	
	$(".total_num").mouseover(function(){
		$(this).find('.jiage').css('display','block');
	});
	$(".total_num").mouseout(function(){
		$(this).find('.jiage').css('display','none');
	});
})
</script>
</body>
</html>